package controller;

import java.util.HashMap;

import project_package.*;

public class EmployeeController {

	EmployeeRecords employeeRecordsCtrl;
	private static EmployeeController instance = null;
	
	public static EmployeeController getInstance()
    {
    	if(instance == null)
    	{
    		instance = new EmployeeController();
    	}
    	return instance;
    }
	
	public EmployeeController() 
	{
		employeeRecordsCtrl = EmployeeRecords.getInstance();
	}
	
	// void -> boolean
	public boolean createEmployee(String name, String phoneNo, String address, long civilNum, double salary, boolean isManager, String password, double salesTotal, int salesNumber)
	{
		return employeeRecordsCtrl.createEmployee(name, phoneNo, address, civilNum, salary, isManager, password, salesTotal, salesNumber);
	}
	
	public boolean updateEmployee(int id, String name, String phoneNo, String address, long civilNum, long datestamp, double salary, boolean isManager, String password, double salesTotal, int salesNumber) 
	{
		return employeeRecordsCtrl.updateEmployee(id, name, phoneNo, address, civilNum, datestamp, salary, isManager, password, salesTotal, salesNumber);
	}

	public boolean deleteEmployee(String name)
	{
		return employeeRecordsCtrl.deleteEmployee(name);
	}
	
	public Employee findEmployee(String name)
	{
		Employee employee = employeeRecordsCtrl.findEmployee(name);
		return employee;
	}
	
	public void printEmployees()
	{
		employeeRecordsCtrl.printEmployees();
	}
	
	public HashMap<Integer, Employee> getEmployees() {
		return employeeRecordsCtrl.getEmployees();
	}
	
	public int getEmployeeNumber()
	{
		int employeeNumber = employeeRecordsCtrl.getEmployeeNumber();
		return employeeNumber;
	}
}